<template>
	<view class="content">
		<image class="logo" src="https://www.diyifanwen.com/files/sucai/shoujitupian/2008-7/13/0871302083517006.jpg"></image>
		<image class="logo" src="/static/logo.png"></image>
		<image class="logo" src="/static/logo.png"></image>
		<image class="logo" src="/static/logo.png"></image>
		<view class="text-area">
			<text class="title">{{title}}</text>
		</view>

		<div>
			<p>点击次数: {{count}}</p>
			<child-1 :btnName1="btnName" @update_count="changeCount" />
		</div>

	</view>



</template>



<script>
	import Child1 from './Child1'


	export default {
		components: {
			'child-1': Child1
		},
		data() {
			return {
				title: 'Hello',
				btnName: ' 我是一个button',
				count: 0
			}
		},
		onLoad() {

		},
		methods: {

			// TreeNode1(val) {
			// 	return{
			// 		val: val,
			// 		left: null,
			// 		right: null
			// 	}
			// },
			changeCount(val) {
				this.count = this.count + val;

				// var treenode = TreeNode(1);
				// var treenode2 = TreeNode(2);   treenode.left =treenode2; 
				// var treenode3 = TreeNode(3);treenode.right =treenode3;
				// 				var treenode5 = TreeNode(5);treenode2.right =treenode5;


				// console.log( binaryTreePaths(treenode))
				// var object =this.$options.methods.TreeNode1(val)
				// console.log( object ) 
				
				 console.log(nthUglyNumber(11))

			},




		},


	}



	function TreeNode(vale) {
		return{
			val: vale,
			left: null,
			right: null
		}
	}
	
	
	
	
	var binaryTreePaths =function(root){
		const paths = [];
		searchnode(root, root.val.toString() ,paths);
		return paths;
	};

	var searchnode =function(node, str ,paths) {
		
		console.log(node);
		console.log(str);
		
		console.log(paths);
		
		if (node) {
			str += node.val;
			if (node.left == null && node.right == null) {
				
				console.log( paths);
				paths.push(str);
			} else {
				str += "->";
				searchnode(node.left , );
				searchnode(node.right)
			}
		}
	};
	
var nthUglyNumber = function(count) {
		var results = 1;
		var a=0;
		var b=0;
		var c=0;
		var pre =1;
		while(pre!=count){
            var tempa =0;  tempa=a+1; while((tempb+1)%3!=0||(tempb+1)%5!=0){ tempa++ }
           	var tempb =0 ; tempb= b+1; while((tempb+1)%5!=0){ tempb++  }
			var tempc  = c+1;
			results = Math.min(tempa*2,tempb*3,tempc*5);
			if(results==tempa*2){
				a =tempa;
			}else if(results == tempb*3)	{
				b =tempb;
			}else{
				c =tempc;
			}
			pre++;
		}
		
		return results;
};
	
	var maxProfit = function(prices) {
	
	}; 
	
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>
